﻿using System;
using System . Collections . Generic;
using System . IO;
using System . Linq;
using System . Runtime . InteropServices . WindowsRuntime;
using Windows . Foundation;
using Windows . Foundation . Collections;
using Windows . UI;
using Windows . UI . Xaml;
using Windows . UI . Xaml . Controls;
using Windows . UI . ViewManagement;
using Windows . UI . Xaml . Media . Animation;
using Windows . UI . Xaml . Controls . Primitives;
using Windows . UI . Xaml . Data;
using Windows . UI . Xaml . Input;
using Windows . UI . Xaml . Media;
using Windows . UI . Xaml . Navigation;

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkID=390556

namespace RichMan4LApp
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class HidePage : Page
    {
        public HidePage ( )
        {
            this . InitializeComponent ( );
        }

        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo ( NavigationEventArgs e )
        {
        }

        private void Page_Loaded ( object sender , RoutedEventArgs e )
        {
            StartStoryBoard . Completed += StartStoryBoard_Completed;
            StartStoryBoard . Begin ( );
        }

        private void StartStoryBoard_Completed ( object sender , object e )
        {
            EasyPage . Navigate ( typeof ( AboutPage ) , null , "Blue" , LeaveStoryBoard , BackGroundRect , Frame );
        }

        int clickTimes=0;

        private void Button_Click ( object sender , RoutedEventArgs e )
        {
            if ( clickTimes < 5 )
            {
                clickTimes++;
            }
            else
            {
                ShowLetterStoryBoard . Begin ( );
                ShowLetterStoryBoard . Completed += ( obj , ev ) =>
                 {
                     Button . Visibility = Visibility . Collapsed;
                     MainGrid . Visibility = Visibility . Collapsed;
                     MainGrid . Opacity = 0;
                     ScrollViewer . Visibility = Visibility . Visible;
                     ScrollViewer . Opacity = 100;
                 };
            }
        }
    }
}
